package com.cancer.common.web;

/**
 * 
 * 
 * @company GeekPlus
 * @project beetle
 * @author 刘俊
 * @date 2016年6月29日
 * @since 1.0.0
 */
public enum APIResult {
	/** 成功 **/
	OK(0, "成功"),
	OK_PART(0, "只有一部分数据受到影响"),
	
	/** 异常或其它未知错误 **/
	ERROR(100, "异常或其它未知错误"),
	/** 异常或其它未知错误 **/
	NOT_SUPPORT(101, "不支持该操作"),
	
	/** 无效的参数 **/
	ILLEGAL_ARGUMENT						(200, "无效的参数"),
	ILLEGAL_ARGUMENT_NOTHING_CHANGED		(200, "没有任何数据受到影响"),
	
	/*================================= 地图资源 ==================================*/ 
	ILLEGAL_ARGUMENT_BLOCK					(201, "资源被占用"),
	ILLEGAL_ARGUMENT_ROBOT					(202, "未找到可用的机器人"),
	ILLEGAL_ARGUMENT_ROBOT_BLOCK			(203, "机器人被占用"),
	ILLEGAL_ARGUMENT_SHELF					(204, "未找到可用的货架"),
	ILLEGAL_ARGUMENT_SHELF_BLOCK			(205, "货架被占用"),
	ILLEGAL_ARGUMENT_CELL					(206, "未找到可用的单元格"),
	ILLEGAL_ARGUMENT_CELL_BLOCK				(207, "单元格被占用"),
	ILLEGAL_ARGUMENT_STATION				(208, "未找到可用的工位"),
	ILLEGAL_ARGUMENT_STATION_BLOCK			(209, "工位被占用"),
	ILLEGAL_ARGUMENT_CHARGINGSTATION		(210, "未找到可用的充电站"),
	ILLEGAL_ARGUMENT_CHARGINGSTATION_BLOCK	(211, "充电站被占用"),
	ILLEGAL_ARGUMENT_NULL					(212, "参数不能为null"),	
	ILLEGAL_ARGUMENT_PATH					(213, "自定义路径错误"),	
	ILLEGAL_ARGUMENT_CELL_SHELFON			(214, "目标单元格已存在货架"),
	ILLEGAL_RESOURCE_TIMEOUT				(215, "资源申请超时"),
	ILLEGAL_ARGUMENT_LAYER					(216, "禁止跨层调用"),
	ILLEGAL_ARGUMENT_ENDPOINT				(217, "终点似乎不可达"),
	ILLEGAL_ARGUMENT_DISABLED				(218, "资源已经被禁用"),
	
	/*================================= api报文 ==================================*/ 
	ILLEGAL_REQUEST(240, "无效的请求报文"),
	ILLEGAL_REQUEST_HEADER(241, "无效的Header"),
	ILLEGAL_REQUEST_BODY(242, "无效的Body"),
	ILLEGAL_REQUEST_VERSION(242, "无效的请求报文"),
	
	/*================================= api验证 ==================================*/ 
	ILLEGAL_CERTIFICATE(250, "无效的凭证"),
	ILLEGAL_USERNAME(251, "无效的用户名"),
	ILLEGAL_PASSWORD(252, "无效的密码"),
	ILLEGAL_USER_NOT_EXIST(253, "用户不存在"),
	
	/*================================= api指令==================================*/
	ILLEGAL_INSTRUCTION(300, "无效的指令"),
	ILLEGAL_INSTRUCTION_DEPRECATED(301, "指令已经被废弃"),
	
	/*================================= api参数和结果==================================*/ 
	RECORD_NOT_EXISTS(400, "记录不存在"),
	RECORD_ALREADY_EXISTED(401, "记录已存在"),
	BATCH_NOT_SPECIFIED(402, "批次未指定"),
	SN_NOT_SPECIFIED(403, "序列号未指定"),
	ORDER_CANCELLED(404, "订单已取消"),
	ORDERS_WAITING_FOR_WEIGHT(405, "存在未称重订单"),
	;
	
	public int code;
	public String msg;

	private APIResult(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}
	
}
